mirror of https://github.com/sm64pc/sm64pc.git
Removed bowser selfkill and added scroll on options menu
This commit is contained in:
parent
7006788327
commit
6b59aef94d
|
@ -97,9 +97,6 @@ void bhv_bowser_body_anchor_loop(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 bowser_spawn_shockwave(void) {
|
s32 bowser_spawn_shockwave(void) {
|
||||||
o->oHealth = -1;
|
|
||||||
o->oAction = 4;
|
|
||||||
return 0;
|
|
||||||
struct Object *wave;
|
struct Object *wave;
|
||||||
if (o->oBehParams2ndByte == 2) {
|
if (o->oBehParams2ndByte == 2) {
|
||||||
wave = spawn_object(o, MODEL_BOWSER_WAVE, bhvBowserShockWave);
|
wave = spawn_object(o, MODEL_BOWSER_WAVE, bhvBowserShockWave);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "moon-screen.h"
|
#include "moon-screen.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "engine/math_util.h"
|
#include "engine/math_util.h"
|
||||||
|
@ -41,25 +42,28 @@ void MoonScreen::Mount(){
|
||||||
|
|
||||||
void MoonScreen::Draw(){
|
void MoonScreen::Draw(){
|
||||||
if(this->enabledWidgets){
|
if(this->enabledWidgets){
|
||||||
for(int i = 0; i < widgets.size(); i++)
|
|
||||||
widgets[i]->Draw();
|
|
||||||
//int widgetAmount = widgets.size();
|
|
||||||
//int maxWidgets = 8;
|
|
||||||
//int iMod = scrollWidgetModifier;
|
|
||||||
|
|
||||||
//for(int i = 0; i < min(widgetAmount, maxWidgets); i++){
|
int widgetsAmount = this->widgets.size();
|
||||||
// int index = i + iMod;
|
int maxWidgets = 8;
|
||||||
|
int iMod = scrollModifier;
|
||||||
|
|
||||||
// if(index > widgetAmount - 1){
|
for(int i = 0; i < min(widgetsAmount, maxWidgets); i++){
|
||||||
// this->scrollIndex = 0;
|
int index = i + iMod;
|
||||||
// scrollWidgetModifier = 0;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// widgets[index]->parent = this;
|
if(index > widgetsAmount - 1){
|
||||||
// widgets[index]->Draw();
|
this->scrollIndex = 0;
|
||||||
// widgets[index]->mY = 15 * iMod;
|
scrollModifier = 0;
|
||||||
//}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto &widget = this->widgets[index];
|
||||||
|
|
||||||
|
if(widget == NULL) return;
|
||||||
|
|
||||||
|
widget->parent = this;
|
||||||
|
widget->y = 57 + (i * 17);
|
||||||
|
widget->Draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,25 +71,25 @@ bool stickExecuted;
|
||||||
|
|
||||||
|
|
||||||
void MoonScreen::changeScroll(int idx){
|
void MoonScreen::changeScroll(int idx){
|
||||||
|
int size = this->widgets.size();
|
||||||
if(idx < 0){
|
if(idx < 0){
|
||||||
if(this->scrollIndex > 0){
|
if(this->scrollIndex > 0){
|
||||||
if(scrollWidgetModifier > 0 && this->scrollIndex == scrollWidgetModifier)
|
if(scrollModifier > 0 && this->scrollIndex == scrollModifier)
|
||||||
scrollWidgetModifier--;
|
scrollModifier--;
|
||||||
this->scrollIndex--;
|
this->scrollIndex--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->scrollIndex = this->widgets.size() - 1;
|
this->scrollIndex = size - 1;
|
||||||
scrollWidgetModifier = this->scrollIndex - 4;
|
scrollModifier = this->scrollIndex - min(7, size - 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this->scrollIndex < this->widgets.size() - 1){
|
if(this->scrollIndex < size - 1){
|
||||||
if(this->scrollIndex > 3 && !((this->scrollIndex - scrollWidgetModifier) % 4)) scrollWidgetModifier++;
|
if(this->scrollIndex > 5 && !((this->scrollIndex - scrollModifier) % 7)) scrollModifier++;
|
||||||
this->scrollIndex++;
|
this->scrollIndex++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->scrollIndex = 0;
|
this->scrollIndex = 0;
|
||||||
scrollWidgetModifier = 0;
|
scrollModifier = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoonScreen::Update(){
|
void MoonScreen::Update(){
|
||||||
|
|
|
@ -18,6 +18,7 @@ class MoonScreen {
|
||||||
protected:
|
protected:
|
||||||
bool enabledWidgets = true;
|
bool enabledWidgets = true;
|
||||||
bool useMouseInstead = false; // unused
|
bool useMouseInstead = false; // unused
|
||||||
|
int scrollModifier = 0;
|
||||||
public:
|
public:
|
||||||
std::vector<MoonWidget*> widgets;
|
std::vector<MoonWidget*> widgets;
|
||||||
MoonWidget* selected;
|
MoonWidget* selected;
|
||||||
|
|
|
@ -11,7 +11,6 @@ bool mwvStickExecuted;
|
||||||
|
|
||||||
MWValue::MWValue(float x, float y, std::wstring title, MWValueBind bind){
|
MWValue::MWValue(float x, float y, std::wstring title, MWValueBind bind){
|
||||||
this->x = x;
|
this->x = x;
|
||||||
this->y = y;
|
|
||||||
this->bind = bind;
|
this->bind = bind;
|
||||||
this->title = title;
|
this->title = title;
|
||||||
this->titleKey = false;
|
this->titleKey = false;
|
||||||
|
@ -19,7 +18,6 @@ MWValue::MWValue(float x, float y, std::wstring title, MWValueBind bind){
|
||||||
|
|
||||||
MWValue::MWValue(float x, float y, std::wstring title, MWValueBind bind, bool titleKey){
|
MWValue::MWValue(float x, float y, std::wstring title, MWValueBind bind, bool titleKey){
|
||||||
this->x = x;
|
this->x = x;
|
||||||
this->y = y;
|
|
||||||
this->bind = bind;
|
this->bind = bind;
|
||||||
this->title = title;
|
this->title = title;
|
||||||
this->titleKey = titleKey;
|
this->titleKey = titleKey;
|
||||||
|
@ -27,7 +25,6 @@ MWValue::MWValue(float x, float y, std::wstring title, MWValueBind bind, bool ti
|
||||||
|
|
||||||
MWValue::MWValue(float x, float y, std::string title, MWValueBind bind){
|
MWValue::MWValue(float x, float y, std::string title, MWValueBind bind){
|
||||||
this->x = x;
|
this->x = x;
|
||||||
this->y = y;
|
|
||||||
this->bind = bind;
|
this->bind = bind;
|
||||||
this->title = wide(title);
|
this->title = wide(title);
|
||||||
this->titleKey = false;
|
this->titleKey = false;
|
||||||
|
@ -35,7 +32,6 @@ MWValue::MWValue(float x, float y, std::string title, MWValueBind bind){
|
||||||
|
|
||||||
MWValue::MWValue(float x, float y, std::string title, MWValueBind bind, bool titleKey){
|
MWValue::MWValue(float x, float y, std::string title, MWValueBind bind, bool titleKey){
|
||||||
this->x = x;
|
this->x = x;
|
||||||
this->y = y;
|
|
||||||
this->bind = bind;
|
this->bind = bind;
|
||||||
this->title = wide(title);
|
this->title = wide(title);
|
||||||
this->titleKey = titleKey;
|
this->titleKey = titleKey;
|
||||||
|
|
Loading…
Reference in New Issue