Skip to content

Commit

Permalink
add other shops in nomenu buying feature
Browse files Browse the repository at this point in the history
  • Loading branch information
TerminalHash committed Jul 15, 2024
1 parent 40174cf commit cb5a402
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 10 deletions.
36 changes: 31 additions & 5 deletions Modules/BindingsModule/BindingsCommon.as
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ string[] page_texts =
Names::knightnmb,
Names::archernmb,
Names::buildernmb,
Names::quartersnmb
Names::quartersnmb,
Names::vehiclenmb,
Names::boatnmb
};

string[][] button_texts =
Expand Down Expand Up @@ -104,6 +106,18 @@ string[][] button_texts =
Names::burgernmb,
Names::pearnmb,
Names::sleepnmb
},
{ // VEHICLE SHOP
Names::catapultnmb,
Names::ballistanmb,
Names::outpostnmb,
Names::boltsnmb,
Names::shellsnmb
},
{ // BOAT SHOP
Names::dinghynmb,
Names::longboatnmb,
Names::warboatnmb
}
};

Expand Down Expand Up @@ -194,6 +208,18 @@ string[][] button_file_names =
"kfc_burger",
"kfc_pear",
"kfc_sleep"
},
{
"vehicle_catapult",
"vehicle_ballista",
"vehicle_outpost",
"vehicle_bolts",
"vehicle_shells",
},
{
"boat_dinghy",
"boat_longboat",
"boat_warboat"
}
};

Expand Down Expand Up @@ -1753,7 +1779,7 @@ class ClickableButtonGUI
GUI::SetFont("menu");

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

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

Expand All @@ -1776,7 +1802,7 @@ class ClickableButtonGUI

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

Expand Down Expand Up @@ -1824,7 +1850,7 @@ class ClickableButtonGUI
u8 scale = screen_height / 720.0;

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

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

Expand All @@ -1847,7 +1873,7 @@ class ClickableButtonGUI

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

Expand Down
23 changes: 23 additions & 0 deletions Modules/BindingsModule/BindingsSystem.as
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void onInit(CRules@ this)
if (!file.exists("k_drill$2")) file.add_s32("k_drill$2", -1);
if (!file.exists("k_satchel$1")) file.add_s32("k_satchel$1", 54);
if (!file.exists("k_satchel$2")) file.add_s32("k_satchel$2", -1);

// builder shop
if (!file.exists("b_drill$1")) file.add_s32("b_drill$1", 49);
if (!file.exists("b_drill$2")) file.add_s32("b_drill$2", -1);
Expand All @@ -65,6 +66,7 @@ void onInit(CRules@ this)
if (!file.exists("b_crate_wood$1")) file.add_s32("b_crate_wood$2", -1);
if (!file.exists("b_crate_coins$1")) file.add_s32("b_crate_coins$1", 48);
if (!file.exists("b_crate_coins$1")) file.add_s32("b_crate_coins$2", -1);

// archer shop
if (!file.exists("a_arrows$1")) file.add_s32("a_arrows$1", 49);
if (!file.exists("a_arrows$2")) file.add_s32("a_arrows$2", -1);
Expand All @@ -76,6 +78,7 @@ void onInit(CRules@ this)
if (!file.exists("a_bombarrows$2")) file.add_s32("a_bombarrows$2", -1);
if (!file.exists("a_blockarrows$1")) file.add_s32("a_blockarrows$1", 53);
if (!file.exists("a_blockarrows$2")) file.add_s32("a_blockarrows$2", -1);

// kfc
if (!file.exists("kfc_beer$1")) file.add_s32("kfc_beer$1", 49);
if (!file.exists("kfc_beer$2")) file.add_s32("kfc_beer$2", -1);
Expand All @@ -90,6 +93,26 @@ void onInit(CRules@ this)
if (!file.exists("kfc_sleep$1")) file.add_s32("kfc_sleep$1", 54);
if (!file.exists("kfc_sleep$2")) file.add_s32("kfc_sleep$2", -1);

// vehicle shop
if (!file.exists("vehicle_catapult$1")) file.add_s32("vehicle_catapult$1", 49);
if (!file.exists("vehicle_catapult$2")) file.add_s32("vehicle_catapult$2", -1);
if (!file.exists("vehicle_ballista$1")) file.add_s32("vehicle_ballista$1", 50);
if (!file.exists("vehicle_ballista$2")) file.add_s32("vehicle_ballista$2", -1);
if (!file.exists("vehicle_outpost$1")) file.add_s32("vehicle_outpost$1", 51);
if (!file.exists("vehicle_outpost$2")) file.add_s32("vehicle_outpost$2", -1);
if (!file.exists("vehicle_bolts$1")) file.add_s32("vehicle_bolts$1", 52);
if (!file.exists("vehicle_bolts$2")) file.add_s32("vehicle_bolts$2", -1);
if (!file.exists("vehicle_shells$1")) file.add_s32("vehicle_shells$1", 53);
if (!file.exists("vehicle_shells$2")) file.add_s32("vehicle_shells$2", -1);

// boat shop
if (!file.exists("boat_dinghy$1")) file.add_s32("boat_dinghy$1", 49);
if (!file.exists("boat_dinghy$2")) file.add_s32("boat_dinghy$2", -1);
if (!file.exists("boat_longboat$1")) file.add_s32("boat_longboat$1", 50);
if (!file.exists("boat_longboat$2")) file.add_s32("boat_longboat$2", -1);
if (!file.exists("boat_warboat$1")) file.add_s32("boat_warboat$1", 51);
if (!file.exists("boat_warboat$2")) file.add_s32("boat_warboat$2", -1);

if(!file.saveFile(BINDINGSFILE + ".cfg"))
{
print("Failed to save GRUHSHA_playerbindings.cfg");
Expand Down
Loading

0 comments on commit cb5a402

Please sign in to comment.