Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge remote-tracking branch 'upstream/master'
  • Loading branch information
Nick007J committed Sep 26, 2020
2 parents 290faa5 + 93d77f3 commit 375c7df00f4b95ca52906cf337fad0eefd18d0da
@@ -450,9 +450,9 @@ int8 cSampleManager::GetCurrent3DProviderIndex(void)

int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
{
ASSERT( nProvider < m_nNumberOfProviders );
if (nProvider >= m_nNumberOfProviders)
nProvider = 0;
ASSERT( nProvider < m_nNumberOfProviders );
int savedprovider = curprovider;

if ( nProvider < m_nNumberOfProviders )
@@ -1682,7 +1682,7 @@ CPathFind::Load(uint8 *buf, uint32 size)
void
CPathFind::DisplayPathData(void)
{
// Not the function from mobm_carPathLinksile but my own!
// Not the function from mobile but my own!

int i, j, k;
// Draw 50 units around camera
@@ -4994,7 +4994,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
// Useless call
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
int handle = CRadar::SetCoordBlip(BLIP_COORD, pos, 2, BLIP_DISPLAY_BOTH);
int handle = CRadar::SetCoordBlip(BLIP_CONTACT_POINT, pos, 2, BLIP_DISPLAY_BOTH);
CRadar::ChangeBlipScale(handle, 3);
ScriptParams[0] = handle;
StoreParameters(&m_nIp, 1);
@@ -9319,7 +9319,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
CVector pos = *(CVector*)&ScriptParams[0];
if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
C3dMarkers::PlaceMarkerSet((uintptr)this + m_nIp, 4, pos, *(float*)&ScriptParams[3],
C3dMarkers::PlaceMarkerSet((uintptr)this + m_nIp, MARKERTYPE_CYLINDER, pos, *(float*)&ScriptParams[3],
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A,
SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
return 0;
@@ -11254,7 +11254,7 @@ void CTheScripts::DrawScriptSpheres()
{
for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
if (ScriptSphereArray[i].m_bInUse)
C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, 4, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius,
C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, MARKERTYPE_CYLINDER, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius,
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
}
}
@@ -1075,6 +1075,38 @@ CMenuManager::Draw()
leftText = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName);
}

#ifdef CUSTOM_FRONTEND_OPTIONS
if (aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot == SAVESLOT_CFO) {
FrontendOption &option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
if (option.type == FEOPTION_SELECT) {
if (option.onlyApplyOnEnter){
if (m_nCurrOption != i) {
if (option.displayedValue != option.lastSavedValue)
SetHelperText(3); // Restored original value

// option.displayedValue = option.lastSavedValue = *option.value;

} else {
if (option.displayedValue != *option.value)
SetHelperText(1); // Enter to apply
else if (m_nHelperTextMsgId == 1)
ResetHelperText(); // Applied
}
}
}

if (m_nCurrOption != lastOption && lastOption == i) {
FrontendOption &oldOption = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[lastOption].m_TargetMenu];
if (oldOption.type == FEOPTION_DYNAMIC || oldOption.type == FEOPTION_BUILTIN_ACTION)
if(oldOption.buttonPressFunc)
oldOption.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);

if (oldOption.onlyApplyOnEnter && oldOption.type == FEOPTION_SELECT)
oldOption.displayedValue = oldOption.lastSavedValue = *oldOption.value;
}
}
#endif

switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
case MENUACTION_CHANGEMENU: {
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu) {
@@ -1477,38 +1509,6 @@ CMenuManager::Draw()
}
}

#ifdef CUSTOM_FRONTEND_OPTIONS
if (aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot == SAVESLOT_CFO) {
FrontendOption &option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
if (option.type == FEOPTION_SELECT) {
if (option.onlyApplyOnEnter){
if (m_nCurrOption != i) {
if (option.displayedValue != option.lastSavedValue)
SetHelperText(3); // Restored original value

// option.displayedValue = option.lastSavedValue = *option.value;

} else {
if (option.displayedValue != *option.value)
SetHelperText(1); // Enter to apply
else if (m_nHelperTextMsgId == 1)
ResetHelperText(); // Applied
}
}
}

if (m_nCurrOption != lastOption && lastOption == i) {
FrontendOption &oldOption = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[lastOption].m_TargetMenu];
if (oldOption.type == FEOPTION_DYNAMIC || oldOption.type == FEOPTION_BUILTIN_ACTION)
if(oldOption.buttonPressFunc)
oldOption.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);

if (oldOption.onlyApplyOnEnter && oldOption.type == FEOPTION_SELECT)
oldOption.displayedValue = oldOption.lastSavedValue = *oldOption.value;
}
}
#endif

// Sliders
int lastActiveBarX;
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
@@ -295,7 +295,10 @@ bool CGame::InitialiseOnceAfterRW(void)
CWorld::Players[0].SetPlayerSkin(CMenuManager::m_PrefsSkinFile);

#ifdef CUSTOM_FRONTEND_OPTIONS
CustomFrontendOptionsPopulate();
if (numCustomFrontendOptions == 0 && numCustomFrontendScreens == 0) {
CustomFrontendOptionsPopulate();
FrontEndMenuManager.LoadSettings();
}
#endif
return true;
}
@@ -177,7 +177,12 @@ wchar* MultiSamplingDraw(bool *disabled, bool userHovering) {
} else {
FrontEndMenuManager.SetHelperText(1);
}
} else {
if (FrontEndMenuManager.m_nDisplayMSAALevel != FrontEndMenuManager.m_nPrefsMSAALevel) {
FrontEndMenuManager.m_nDisplayMSAALevel = FrontEndMenuManager.m_nPrefsMSAALevel;
}
}

if (!FrontEndMenuManager.m_bGameNotLoaded)
*disabled = true;

@@ -305,7 +310,7 @@ CustomFrontendOptionsPopulate(void)
#endif
// -- Graphics/display seperation preperation end

static const wchar* off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") };
const wchar* off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") };

#ifdef MORE_LANGUAGES
FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, -2);
@@ -326,7 +331,7 @@ CustomFrontendOptionsPopulate(void)
CLONE_OPTION(TheText.Get("FED_WIS"), MENUACTION_WIDESCREEN, nil, nil)

#ifdef IMPROVED_VIDEOMODE
static const wchar* screenModes[] = { (wchar*)L"FULLSCREEN", (wchar*)L"WINDOWED" };
const wchar* screenModes[] = { TheText.Get("FED_FLS"), TheText.Get("FED_WND") };
// Storing isn't enabled because it's handled in Frontend
FrontendOptionAddSelect(TheText.Get("FEM_SCF"), screenModes, 2, (int8*)&FrontEndMenuManager.m_nPrefsWindowed, true, ScreenModeChange, nil);
#endif
@@ -76,6 +76,10 @@ RemoveCustomFrontendOptions()
for (int j = 0; j < NUM_MENUROWS; j++) {
if (aScreens[i].m_aEntries[j].m_SaveSlot == SAVESLOT_CFO) {
int ogOptionId = customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].ogOptionId;

if (customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].type == FEOPTION_SELECT)
free(customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].rightTexts);

if (ogOptionId == -1) {
int k;
for (k = j; k < NUM_MENUROWS - 1; k++) {
@@ -219,7 +223,8 @@ void FrontendOptionAddSelect(const wchar* leftText, const wchar** rightTexts, in
FrontendOption& option = customFrontendOptions[numCustomFrontendOptions - 1];
option.type = FEOPTION_SELECT;
TextCopy(option.leftText, leftText);
option.rightTexts = rightTexts;
option.rightTexts = (wchar**)malloc(numRightTexts * sizeof(wchar*));
memcpy(option.rightTexts, rightTexts, numRightTexts * sizeof(wchar*));
option.numRightTexts = numRightTexts;
option.value = var;
option.displayedValue = *var;
@@ -107,7 +107,7 @@ struct FrontendOption

// Only for static/select
struct {
const wchar** rightTexts;
wchar** rightTexts;
int8 numRightTexts;
bool onlyApplyOnEnter;
ChangeFunc changeFunc;

0 comments on commit 375c7df

Please sign in to comment.