Skip to content

Commit

Permalink
add nomenu buying items (thanks you, bunnie)
Browse files Browse the repository at this point in the history
  • Loading branch information
TerminalHash committed Jul 15, 2024
1 parent 2ef446f commit 40174cf
Show file tree
Hide file tree
Showing 10 changed files with 958 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Base/Entities/Characters/Archer/Archer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ $sprite_factory = generic_sprite
DrawHoverMessages.as;
ItemNerf.as;
RotateSpriteOnMove.as;
NoMenuBuying.as;

$sprite_texture = ArcherMale.png
s32_sprite_frame_width = 32
Expand Down Expand Up @@ -167,6 +168,7 @@ $inventory_name = Backpack
$name = archer
@$scripts = RunnerDefault.as;
StandardControls.as;
NoMenuBuying.as;
ScreenShakeOnHit.as;
StandardPickup.as;
ActivateHeldObject.as;
Expand Down
2 changes: 2 additions & 0 deletions Base/Entities/Characters/Builder/Builder.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $sprite_factory = generic_sprite
DrawHoverMessages.as;
ItemNerf.as;
RotateSpriteOnMove.as;
NoMenuBuying.as;

$sprite_texture = BuilderMale.png
s32_sprite_frame_width = 32
Expand Down Expand Up @@ -222,6 +223,7 @@ $inventory_name = Backpack
$name = builder
@$scripts = RunnerDefault.as;
StandardControls.as;
NoMenuBuying.as;
ScreenShakeOnHit.as;
StandardPickup.as;
ActivateHeldObject.as;
Expand Down
2 changes: 2 additions & 0 deletions Base/Entities/Characters/Knight/Knight.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ $sprite_factory = generic_sprite
DrawHoverMessages.as;
ItemNerf.as;
RotateSpriteOnMove.as;
NoMenuBuying.as;

$sprite_texture = KnightMale.png
s32_sprite_frame_width = 32
Expand Down Expand Up @@ -322,6 +323,7 @@ $inventory_name = Backpack
$name = knight
@$scripts = RunnerDefault.as;
StandardControls.as;
NoMenuBuying.as;
ScreenShakeOnHit.as;
StandardPickup.as;
ActivateHeldObject.as;
Expand Down
5 changes: 5 additions & 0 deletions Base/Scripts/Emotes/EmoteHotkeys.as
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ void onTick(CBlob@ this)
return;
}

if (getGameTime() - this.get_u32("boughtitemx") < 3)
{
return;
}

CControls@ controls = getControls();

for (uint i = 0; i < 9; i++)
Expand Down
168 changes: 160 additions & 8 deletions Modules/BindingsModule/BindingsCommon.as
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ string[] page_texts =
Names::emotemenu,
Names::actionsmenu,
Names::settingsmenu,
Names::vsettingsmenu
Names::vsettingsmenu,
Names::knightnmb,
Names::archernmb,
Names::buildernmb,
Names::quartersnmb
};

string[][] button_texts =
Expand Down Expand Up @@ -59,6 +63,47 @@ string[][] button_texts =
Names::cancelarrowschargingcommand,
Names::markbuildercommand,
Names::activateorthrowbomb
},
{
"Go away" // TECHNICAL LINE DONT TOUCH PLEASE
},
{
"Why you fucking reading this???" // TECHNICAL LINE DONT TOUCH PLEASE
},
{ // KNIGHT SHOP
Names::bombnmb,
Names::waterbombnmb,
Names::minenmb,
Names::kegnmb,
Names::drillnmb,
Names::satchelnmb
},
{ // ARCHER SHOP
Names::arrowsnmb,
Names::waterarrowsnmb,
Names::firearrowsnmb,
Names::bombarrowsnmb,
Names::blockarrowsnmb
},
{ // BUILDER SHOP
Names::drillbnmb,
Names::spongebnmb,
Names::bucketwnmb,
Names::bouldernmb,
Names::lanternnmb,
Names::bucketnnmb,
Names::trampolinenmb,
Names::sawnmb,
Names::cratewoodnmb,
Names::cratecoinsnmb
},
{ // QUARTERS
Names::beernmb,
Names::mealnmb,
Names::eggnmb,
Names::burgernmb,
Names::pearnmb,
Names::sleepnmb
}
};

Expand Down Expand Up @@ -108,6 +153,47 @@ string[][] button_file_names =
"cancel_charging",
"mark_team_builder",
"activate_or_throw_bomb"
},
{
"go away" // TECHNICAL LINE DONT TOUCH PLEASE
},
{
"why you fucking reading this???" // TECHNICAL LINE DONT TOUCH PLEASE
},
{
"k_bomb",
"k_waterbomb",
"k_mine",
"k_keg",
"k_drill",
"k_satchel"
},
{
"a_arrows",
"a_waterarrows",
"a_firearrows",
"a_bombarrows",
"a_blockarrows"
},
{
"b_drill",
"b_sponge",
"b_bucketw",
"b_boulder",
"b_lantern",
"b_bucketn",
"b_trampoline",
"b_saw",
"b_crate_wood",
"b_crate_coins"
},
{
"kfc_beer",
"kfc_meal",
"kfc_egg",
"kfc_burger",
"kfc_pear",
"kfc_sleep"
}
};

Expand All @@ -121,7 +207,9 @@ string[][] setting_texts =
Names::drillbuilder,
Names::drillarcher,
Names::bombbuilder,
Names::bombarcher
Names::bombarcher,
Names::nomenubuyingset,
Names::nomenubuyingboldarset
}
};

Expand All @@ -134,7 +222,9 @@ string[][] setting_file_names =
"pickdrill_builder",
"pickdrill_archer",
"pickbomb_builder",
"pickbomb_archer"
"pickbomb_archer",
"nomenubuying",
"nomenubuying_b",
}
};

Expand Down Expand Up @@ -168,6 +258,14 @@ string[][][] setting_options =
{
Descriptions::universalno, // 10 BOMB AUTOPICKUP FOR ARCHER
Descriptions::universalyes // 20
},
{
Descriptions::universalno, // 10 NO MENU BUYING
Descriptions::universalyes // 20
},
{
Descriptions::universalno, // 10 NO MENU BUYING (BOLDAR)
Descriptions::universalyes // 20
}
}
};
Expand Down Expand Up @@ -202,6 +300,14 @@ string[][][] setting_option_names =
{
"no", // 10 BOMB AUTOPICKUP FOR ARCHER
"yes" // 20
},
{
"no", // 10 NO MENU BUYING
"yes" // 20
},
{
"no", // 10 NO MENU BUYING (BOLDAR)
"yes" // 20
}
}
};
Expand All @@ -211,6 +317,8 @@ string[][] vsetting_texts =
{
{
Names::blockbar,
Names::shownomenubuyingpan,
Names::dsewnmb,
Names::camerasw,
Names::bodytilt,
Names::headrotating,
Expand All @@ -229,6 +337,8 @@ string[][] vsetting_file_names =
{
{
"blockbar_hud",
"shownomenupanel",
"dse_while_using_nomenu_buying",
"camera_sway",
"body_tilting",
"head_rotating",
Expand All @@ -250,6 +360,14 @@ string[][][] vsetting_options =
Descriptions::universalno, // 10 BLOCKBAR ON HUD
Descriptions::universalyes // 20
},
{
Descriptions::universalno, // 10 SHOW NOMENU BUYING PANEL
Descriptions::universalyes // 20
},
{
Descriptions::universalno, // 10 DONT SHOW EMOTES WHILE USING NOMENU BUYING
Descriptions::universalyes // 20
},
{
"1", // 1 CAMERA SWAY
"2", // 2
Expand Down Expand Up @@ -307,6 +425,14 @@ string[][][] vsetting_option_names =
"no", // 10 BLOCKBAR
"yes" // 20
},
{
"no", // 10 SHOW NOMENU BUYING PANEL
"yes" // 20
},
{
"no", // 10 DONT SHOW EMOTES WHILE USING NOMENU BUYING
"yes" // 20
},
{
"1", // 1 CAMERA SWAY
"2", // 2
Expand Down Expand Up @@ -1364,6 +1490,22 @@ class ClickableButtonTwo
params.ResetBitIndex();
//getRules().SendCommand(cmd_id, params);
fakeCommand(getRules(), cmd_id, @params);

BindingGUI.current_page = cmd_subid;

for (int i=0; i<BindingGUI.page_buttons.length; ++i)
{
if (i != cmd_subid)
BindingGUI.page_buttons[i].m_selected = false;
}

for (int i=0; i<BindingGUI.buttons.length; ++i)
{
for (int g=0; g<BindingGUI.buttons[i].length; ++g)
{
BindingGUI.buttons[i][g].m_selected = false;
}
}
}
}
else
Expand Down Expand Up @@ -1611,7 +1753,7 @@ class ClickableButtonGUI
GUI::SetFont("menu");

Vec2f start_offset = Vec2f(50, 600);
Vec2f start_offset_p = Vec2f(30, 600);
Vec2f start_offset_p = Vec2f(60, 550);

closebutton.Render(m_clickable_origin + Vec2f(1000 - 40, 0), Vec2f(40, 40));

Expand All @@ -1630,7 +1772,12 @@ class ClickableButtonGUI
{
page_buttons[i].Render(m_clickable_origin + start_offset_p, page_button_size);

start_offset_p += Vec2f(page_button_size.x + 10, 0);
start_offset_p += Vec2f(page_button_size.x + 15, 0);

if (i == 5)
{
start_offset_p = Vec2f(205, 600);
}
}

if (current_page == magic_number_v)
Expand Down Expand Up @@ -1677,7 +1824,7 @@ class ClickableButtonGUI
u8 scale = screen_height / 720.0;

Vec2f start_offset = Vec2f(50, 600);
Vec2f start_offset_p = Vec2f(30, 600);
Vec2f start_offset_p = Vec2f(60, 550);

closebutton.Update(m_clickable_origin + Vec2f(1000 - 40, 0), Vec2f(40, 40));

Expand All @@ -1692,11 +1839,16 @@ class ClickableButtonGUI
localbuttonsize = ENTRY_SIZE2;
}

for (int i=0; i<page_buttons.length; ++i)
for (int i = 0; i < page_buttons.length; ++i)
{
page_buttons[i].Update(m_clickable_origin + start_offset_p, page_button_size);

start_offset_p += Vec2f(page_button_size.x + 10, 0);
start_offset_p += Vec2f(page_button_size.x + 15, 0);

if (i == 5)
{
start_offset_p = Vec2f(205, 600);
}
}

if (current_page == magic_number_v)
Expand Down
Loading

0 comments on commit 40174cf

Please sign in to comment.