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) {
|
||||
o->oHealth = -1;
|
||||
o->oAction = 4;
|
||||
return 0;
|
||||
struct Object *wave;
|
||||
if (o->oBehParams2ndByte == 2) {
|
||||
wave = spawn_object(o, MODEL_BOWSER_WAVE, bhvBowserShockWave);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "moon-screen.h"
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
extern "C" {
|
||||
#include "engine/math_util.h"
|
||||
|
@ -41,25 +42,28 @@ void MoonScreen::Mount(){
|
|||
|
||||
void MoonScreen::Draw(){
|
||||
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 index = i + iMod;
|
||||
int widgetsAmount = this->widgets.size();
|
||||
int maxWidgets = 8;
|
||||
int iMod = scrollModifier;
|
||||
|
||||
// if(index > widgetAmount - 1){
|
||||
// this->scrollIndex = 0;
|
||||
// scrollWidgetModifier = 0;
|
||||
// return;
|
||||
// }
|
||||
for(int i = 0; i < min(widgetsAmount, maxWidgets); i++){
|
||||
int index = i + iMod;
|
||||
|
||||
// widgets[index]->parent = this;
|
||||
// widgets[index]->Draw();
|
||||
// widgets[index]->mY = 15 * iMod;
|
||||
//}
|
||||
if(index > widgetsAmount - 1){
|
||||
this->scrollIndex = 0;
|
||||
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){
|
||||
int size = this->widgets.size();
|
||||
if(idx < 0){
|
||||
if(this->scrollIndex > 0){
|
||||
if(scrollWidgetModifier > 0 && this->scrollIndex == scrollWidgetModifier)
|
||||
scrollWidgetModifier--;
|
||||
if(scrollModifier > 0 && this->scrollIndex == scrollModifier)
|
||||
scrollModifier--;
|
||||
this->scrollIndex--;
|
||||
return;
|
||||
}
|
||||
this->scrollIndex = this->widgets.size() - 1;
|
||||
scrollWidgetModifier = this->scrollIndex - 4;
|
||||
this->scrollIndex = size - 1;
|
||||
scrollModifier = this->scrollIndex - min(7, size - 1);
|
||||
return;
|
||||
}
|
||||
if(this->scrollIndex < this->widgets.size() - 1){
|
||||
if(this->scrollIndex > 3 && !((this->scrollIndex - scrollWidgetModifier) % 4)) scrollWidgetModifier++;
|
||||
if(this->scrollIndex < size - 1){
|
||||
if(this->scrollIndex > 5 && !((this->scrollIndex - scrollModifier) % 7)) scrollModifier++;
|
||||
this->scrollIndex++;
|
||||
return;
|
||||
}
|
||||
|
||||
this->scrollIndex = 0;
|
||||
scrollWidgetModifier = 0;
|
||||
scrollModifier = 0;
|
||||
}
|
||||
|
||||
void MoonScreen::Update(){
|
||||
|
|
|
@ -18,6 +18,7 @@ class MoonScreen {
|
|||
protected:
|
||||
bool enabledWidgets = true;
|
||||
bool useMouseInstead = false; // unused
|
||||
int scrollModifier = 0;
|
||||
public:
|
||||
std::vector<MoonWidget*> widgets;
|
||||
MoonWidget* selected;
|
||||
|
|
|
@ -11,7 +11,6 @@ bool mwvStickExecuted;
|
|||
|
||||
MWValue::MWValue(float x, float y, std::wstring title, MWValueBind bind){
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->bind = bind;
|
||||
this->title = title;
|
||||
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){
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->bind = bind;
|
||||
this->title = title;
|
||||
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){
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->bind = bind;
|
||||
this->title = wide(title);
|
||||
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){
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->bind = bind;
|
||||
this->title = wide(title);
|
||||
this->titleKey = titleKey;
|
||||
|
|
Loading…
Reference in New Issue