Skip to content

Commit

Permalink
Merge pull request #19 from Die4Ever/openrct2-v0.4.11
Browse files Browse the repository at this point in the history
Openrct2 v0.4.11
  • Loading branch information
Crazycolbster committed May 6, 2024
2 parents 041da9e + 64dbecd commit 13d167a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
18 changes: 5 additions & 13 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,11 @@ function runNextTick(func: Function) {
}

function ifPaused(whenPaused: () => void, whenUnpaused: () => void) {
var wasPaused = { wasPaused: undefined };
var oldElapsed = date.ticksElapsed;
context.setTimeout(function() {
if( date.ticksElapsed == oldElapsed ) {
wasPaused.wasPaused = true;
if(whenPaused)
whenPaused();
} else {
wasPaused.wasPaused = false;
if(whenUnpaused)
whenUnpaused();
}
}, 100);
var wasPaused = context.paused;

if(wasPaused) whenPaused();
else whenUnpaused();

return wasPaused;
}

Expand Down
12 changes: 5 additions & 7 deletions src/gui/archipelagoWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ function archipelagoGui(){
archipelago_settings.started = true;
saveArchipelagoProgress();//Save the settings to our Archipelago tracker
// we need to unpause the game in order for the next tick to run
var wasPaused = UnpauseGame();
UnpauseGame();
runNextTick(function() {
initRando();
if(wasPaused.wasPaused && global_settings.auto_pause) {
// we know the game is currently unpaused because we're inside a tick event
// so we don't need the fancy PauseGame function
context.executeAction('pausetoggle', {});
if(global_settings.auto_pause) {
PauseGame();
}
createChangesWindow();
});
Expand Down Expand Up @@ -134,8 +132,8 @@ function archipelagoLocations(){
var Archipelago = GetModule("RCTRArchipelago") as RCTRArchipelago;
var messageLog = context.getParkStorage().get("RCTRando.MessageLog") as Array<any>;

var game_choice = ["Ocarina of Time", "Adventure", "Donkey Kong Country 3", "Final Fantasy 1", "Hollow Knight",
"The Legend of Zelda", "A Link to the Past", "Links Awakening", "Pokemon Red and Blue", "Rogue Legacy",
var game_choice = ["Ocarina of Time", "Adventure", "Donkey Kong Country 3", "Final Fantasy 1", "Hollow Knight",
"The Legend of Zelda", "A Link to the Past", "Links Awakening", "Pokemon Red and Blue", "Rogue Legacy",
"Sonic Adventure 2", "Super Mario World", "Super Mario 64", "Super Metroid", "VVVVVV"];
var game = game_choice[Math.floor(Math.random() * game_choice.length)];//Gotta throw that shade

Expand Down
8 changes: 3 additions & 5 deletions src/gui/newGameWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ function startGameGui() {
settings.num_months_cycle = randoCycles[cycle['text']];

// we need to unpause the game in order for the next tick to run
var wasPaused = UnpauseGame();
UnpauseGame();
runNextTick(function() {
initRando();
if(wasPaused.wasPaused && global_settings.auto_pause) {
// we know the game is currently unpaused because we're inside a tick event
// so we don't need the fancy PauseGame function
context.executeAction('pausetoggle', {});
if(global_settings.auto_pause) {
PauseGame();
}
createChangesWindow();
});
Expand Down
8 changes: 4 additions & 4 deletions src/modules/ridetypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ class RCTRRideTypes extends ModuleBase {

if(isRide) {
this.SetRideTypeSeed(rideTypeId, 'ride');
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'excitement', -1) || changed;
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'intensity', 0, isIntense ? 0.5 : 1.0) || changed;
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'nausea', -1, 0.7) || changed;
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'excitement', -1, 0.5) || changed;
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'intensity', 0, isIntense ? 0.3 : 0.5) || changed;
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'nausea', -1, 0.3) || changed;
}

if(ride && ride.runningCost > 0) {
this.SetRideTypeSeed(rideTypeId, 'runningCost');
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'runningCost', 1) || changed;
changed = this.RandomizeRideTypeField(ride, rideTypeName, rideTypeId, 'runningCost', 1, 0.5) || changed;
}

/*if(changed) {
Expand Down
2 changes: 1 addition & 1 deletion src/rctrando_init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let initedMenuItems:boolean = false;
let subscriptions = []

const minApiVersion = 52;// or 60?
const targetApiVersion = 82;// v0.4.8
const targetApiVersion = 84;// v0.4.11
info(" \n"+rando_name+" v"+rando_version
+ ", OpenRCT2 API version "+context.apiVersion+', minimum required API version is '+minApiVersion+', recommended API version is '+targetApiVersion
+ ', network.mode: '+network.mode+', context.mode: '+context.mode
Expand Down

0 comments on commit 13d167a

Please sign in to comment.